clear all
close all

%filename = "/media/d/mgr_wyniki/11_y_none_b_none.sh_results/1_stats/yellow1.stats";

%filename = "/media/d/mgr_wyniki/11_y_none_b_none.sh_results/10_stats/yellow4.stats";

%super widoczne role i podzial
filename = "/media/d/mgr_wyniki/01_y_ABC_b_ABC.sh_results/2_stats/yellow4.stats"
%filename = "/media/d/mgr_wyniki/01_y_ABC_b_ABC.sh_results/2_stats/yellow3.stats"

COLUMN_ATTACKING = 6;
COLUMN_BALL_IN = 7;
COLUMN_SHOTS_COUNT = 12;
COLUMN_SUCCESSFUL_PASS = 13;
COLUMN_SUCCESSFUL_CAPTURE = 14;

rawData = load ('-ascii',filename);
ballInData = rawData(find(rawData(:,COLUMN_BALL_IN) > 0), :);

attackingData = ballInData(find(ballInData(:,COLUMN_ATTACKING) > 0), :);
defendingData = ballInData(find(ballInData(:,COLUMN_ATTACKING) <= 0), :);

plotPositions(ballInData(: , 1), ballInData(: , 2), 1);
plotPositions(attackingData(: , 1), attackingData(: , 2), 2);
plotPositions(defendingData(: , 1), defendingData(: , 2), 3);

shotCount = sum(ballInData(find(ballInData(:,COLUMN_SHOTS_COUNT) > 0) , COLUMN_SHOTS_COUNT));
passCount = sum(ballInData(find(ballInData(:,COLUMN_SUCCESSFUL_PASS) > 0) , COLUMN_SUCCESSFUL_PASS));
captureCount = sum(ballInData(find(ballInData(:,COLUMN_SUCCESSFUL_CAPTURE) > 0) , COLUMN_SUCCESSFUL_CAPTURE));

%figure(4)
%bar([1 2 3],[shotCount passCount captureCount])

